home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / tclMotif-1.4 / programs / address next >
Text File  |  1995-06-29  |  2KB  |  60 lines

  1. #!../src/moat
  2.  
  3. xtAppInitialize
  4.  
  5. # widgets
  6. xmMainWindow .main managed
  7. xmForm .main.form managed
  8. xmList .main.form.list managed \
  9.     -selectionPolicy single_select
  10. xmLabel .main.form.Name managed \
  11.     -alignment alignment_end
  12. xmLabel .main.form.Telephone managed \
  13.     -alignment alignment_end
  14. xmText .main.form.name managed
  15. xmText .main.form.telephone managed
  16.  
  17. # geometry
  18. .main.form.list setValues \
  19.     -topAttachment attach_form \
  20.     -leftAttachment attach_form \
  21.     -bottomAttachment attach_form
  22. .main.form.Name setValues \
  23.     -topAttachment attach_form \
  24.     -leftAttachment attach_widget \
  25.     -leftWidget .main.form.list \
  26.     -rightAttachment attach_opposite_widget \
  27.     -rightWidget .main.form.Telephone
  28. .main.form.Telephone setValues \
  29.     -topAttachment attach_position \
  30.     -topPosition 50 \
  31.     -leftAttachment attach_widget \
  32.     -leftWidget .main.form.list
  33. .main.form.name setValues \
  34.     -topAttachment attach_form \
  35.     -rightAttachment attach_form \
  36.     -leftAttachment attach_widget \
  37.     -leftWidget .main.form.Name
  38. .main.form.telephone setValues \
  39.     -topAttachment attach_position \
  40.     -topPosition 50 \
  41.     -rightAttachment attach_form \
  42.     -leftAttachment attach_widget \
  43.     -leftWidget .main.form.Telephone
  44.  
  45. # set values in List
  46. .main.form.list setValues \
  47.     -items {"Jan Newmarch" "John Ousterhout" "Stephen Prendergast"} \
  48.     -itemCount 3
  49.  
  50. # add a callback
  51. .main.form.list singleSelectionCallback {
  52.     .main.form.name setValues \
  53.     -value "%item"
  54. }
  55.  
  56. # set it going
  57.  
  58. . realizeWidget
  59. . mainLoop
  60.